home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
SLGetPrinterList.z
/
SLGetPrinterList
Wrap
Text File
|
1998-10-30
|
9KB
|
198 lines
SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333))))
NNNNAAAAMMMMEEEE
SLGetPrinterList, SLGetPrinterInfo - get printer information
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
####iiiinnnncccclllluuuuddddeeee <<<<ssssppppoooooooollll....hhhh>>>>
iiiinnnntttt SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((SSSSLLLLPPPPrrrriiiinnnntttteeeerrrrSSSSttttrrrruuuucccctttt ****pppprrrriiiinnnntttteeeerrrrsssspppp[[[[]]]],,,,
iiiinnnntttt ****nnnnuuuummmm____pppprrrriiiinnnntttteeeerrrrsssspppp))));;;;
iiiinnnntttt SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrIIIInnnnffffoooo((((ccccoooonnnnsssstttt cccchhhhaaaarrrr ****pppprrrriiiinnnntttteeeerrrr,,,,
SSSSLLLLPPPPrrrriiiinnnntttteeeerrrrSSSSttttrrrruuuucccctttt ********ppppiiiinnnnffffoooo))));;;;
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
_S_L_G_e_t_P_r_i_n_t_e_r_L_i_s_t returns a list of the printers registered with the
default spooling system. _p_r_i_n_t_e_r_s_p is set by the function to point to a
list of _S_L_P_r_i_n_t_e_r_S_t_r_u_c_t structures. These structures contain detailed
information about each printer. _n_u_m__p_r_i_n_t_e_r_s_p is set to the number of
printers in the list. The returned list of printers is sorted
alphabetically according to the _l_o_c_a_l__n_a_m_e field. The sort is case
independent.
_S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o returns information about a single printer. _p_r_i_n_t_e_r
specifies the name of the printer for which information is desired. If
_p_r_i_n_t_e_r is NNNNUUUULLLLLLLL, the default printer will be used. _p_i_n_f_o is set by the
function to point to a _S_L_P_r_i_n_t_e_r_S_t_r_u_c_t structure containing the
information about the printer.
The _S_L_P_r_i_n_t_e_r_S_t_r_u_c_t is defined as:
typedef struct _slPrinterStruct {
char *local_name; /* Local printer name */
char *formal_name; /* Formal printer name */
char *type; /* Printer type (eg. Color) */
char *dev; /* Port name (eg. /dev/plp) */
unsigned int is_def: 1; /* 1 == default printer */
unsigned int is_class: 1; /* 1 == printer is class */
unsigned int is_networked: 1; /* 1 == network printer */
unsigned int _padding: 29; /* Unused - for alignment */
char *remote_host; /* Remote machine name */
char *remote_name; /* Remote printer name */
char *network_type; /* Remote machine type */
} SLPrinterStruct;
RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
0 is returned if execution was successful. -1 is returned and _S_L_e_r_r_n_o is
set if an execution error has occurred.
EEEEXXXXEEEECCCCUUUUTTTTIIIIOOOONNNN EEEERRRRRRRROOOORRRR CCCCOOOODDDDEEEESSSS
_S_L_G_e_t_P_r_i_n_t_e_r_L_i_s_t and _S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o will fail under the following
circumstances.
PPPPaaaaggggeeee 1111
SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333))))
SL_ERR_FIND_SPOOLER An error occurred while attempting to determine
the available printer spooling systems.
SL_ERR_NO_SPOOLERS There are no printer spooling systems available.
In addition, _S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o will fail under the following conditions.
SL_ERR_NO_DEF_PRINTER There is no default printer registered with the
printer spooling system.
SL_ERR_BAD_PRINTER_NAME The printer name specified is either an empty
string (""), or a string consisting entirely of
whitespace.
SL_ERR_BAD_CLASS_MEMBER The specified printer class contains an invalid
printer.
WWWWAAAARRRRNNNNIIIINNNNGGGG
A pointer to _p_r_i_n_t_e_r_s_p obtained by a previous call to _S_L_G_e_t_P_r_i_n_t_e_r_L_i_s_t
will be invalid after subsequent calls to the function. The contents of
the printer list _p_r_i_n_t_e_r_s_p must be copied to be preserved. Note that the
character string fields of the structure must be duplicated in any copy
operation since these pointers also become invalid. Similarly, the
contents of the structure pointed to by _p_i_n_f_o will not be preserved
across calls to _S_L_G_e_t_P_r_i_n_t_e_r_I_n_f_o.
NNNNOOOOTTTTEEEESSSS
The following notes refer to BSD and System V systems to indicate the use
of the BSD and System V printer spooling systems respectively. All
mention of "fields" refers to the fields of the _S_L_P_r_i_n_t_e_r_S_t_r_u_c_t
structure.
1. On BSD systems it is assumed that the _f_o_r_m_a_l__n_a_m_e field is the last
printer name to appear in the /_e_t_c/_p_r_i_n_t_c_a_p entry printer name list.
2. On any spooling system, if the _f_o_r_m_a_l__n_a_m_e cannot be determined it
will be set to the value of _t_y_p_e.
3. On BSD systems the printer type (_t_y=) may not be specified in the
/_e_t_c/_p_r_i_n_t_c_a_p file entry for the printer. In that case the _t_y_p_e
field will be set to the string "Unknown".
4. If a printer is not physically connected to the user's workstation,
but is accessed over the network, the printer is called a networked
printer. If a printer is networked, the _d_e_v field will be set to a
NNNNUUUULLLLLLLL pointer.
5. If the printer is physically connected to the user's workstation, it
is called a local printer. If a printer is local, the _r_e_m_o_t_e__h_o_s_t,
_r_e_m_o_t_e__n_a_m_e, and _n_e_t_w_o_r_k__t_y_p_e fields will be set to the NNNNUUUULLLLLLLL
pointer.
PPPPaaaaggggeeee 2222
SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333)))) IIIImmmmpppprrrreeeessssssssaaaarrrriiiioooo SSSSLLLLGGGGeeeettttPPPPrrrriiiinnnntttteeeerrrrLLLLiiiisssstttt((((3333))))
6. On BSD systems one physical printer can be referred to by many
names. Therefore, it is possible for more than one printer in the
printer list to be marked as the default printer (i.e. _d_e_f = 1).
7. On System V systems the _i_s__c_l_a_s_s field is set to 1 if the printer is
actually a printer class rather than an actual physical printer. On
BSD systems this field is always set to 0.
SSSSEEEEEEEE AAAALLLLSSSSOOOO
SLGetDefPrinterName(3), SLPerror(3), libspool(3)
PPPPaaaaggggeeee 3333